#include <Arduino.h>
#include <lvgl.h>
#include "touch.hpp"
#include "screen.hpp"
#include "ui.h"
#include "events.h"
// #include "global_valuables.h"
#include "repeat_sender.h"
void setup()
{
    Serial.begin(115200);
    Serial.setTimeout(1);
    screenInit();
    touchInit();
    ui_init();
}


void loop()
{
    static String data;
    if(Serial.available()){
        data = Serial.readStringUntil('\n');
        lv_textarea_add_text(ui_TextAreaMonitor, data.c_str());
        lv_timer_handler();
        lv_task_handler();
    }
    if (sending){
        reapt_sender_looper(500);
    }
    lv_timer_handler(); /* let the GUI do its work */
    delay(5);
}
